package com.jyxd.web.controller.basic;

import com.jyxd.web.data.basic.RespiratorySystemInfo;
import com.jyxd.web.data.dto.HttpResult;
import com.jyxd.web.service.assessment.basic.RespiratorySystemInfoService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.Map;

/**
 * 呼吸系统信息（护理单一呼吸系统用）
 */
@Api(tags = "呼吸系统信息（护理单一呼吸系统用）")
@Controller
@RequestMapping(value = "/RespiratorySystemInfo")
public class RespiratorySystemInfoController {

    private static Logger logger= LoggerFactory.getLogger(RespiratorySystemInfoController.class);

    @Autowired
    private RespiratorySystemInfoService respiratorySystemInfoService;

    /**
     * 增加一条呼吸系统信息表记录
     * @return
     */
    @ApiOperation("增加一条呼吸系统信息表记录")
    @RequestMapping(value = "/insert",method= RequestMethod.POST)
    @ResponseBody
    public HttpResult insert(@RequestBody RespiratorySystemInfo respiratorySystemInfo){
        return respiratorySystemInfoService.insert(respiratorySystemInfo);
    }

    /**
     * 更新呼吸系统信息表记录状态
     * @param respiratorySystemInfo
     * @return
     */
    @ApiOperation("更新呼吸系统信息表记录状态")
    @RequestMapping(value = "/update",method= RequestMethod.POST)
    @ResponseBody
    public HttpResult update(@RequestBody RespiratorySystemInfo respiratorySystemInfo){
        return respiratorySystemInfoService.update(respiratorySystemInfo);
    }
    /**
     * 根据patientId查询呼吸系统信息表记录
     * @param map
     * @return
     */
    @ApiOperation("根据patientId查询呼吸系统信息表记录")
    @RequestMapping(value = "/queryData",method= RequestMethod.POST)
    @ResponseBody
    public HttpResult queryData(@RequestBody(required=false) Map<String,Object> map){
        return respiratorySystemInfoService.queryData(map);
    }

    /**
     * 根据条件分页查询呼吸系统信息表记录列表（也可以不分页）
     * @param map
     * @return
     */
    @RequestMapping(value = "/queryList",method= RequestMethod.POST)
    @ResponseBody
    public HttpResult queryList(@RequestBody(required=false) Map<String,Object> map){
        return  respiratorySystemInfoService.queryList(map);
    }

}
